AltTabPopup.prototype = {
_init : function() {
- let global = Shell.Global.get();
-
this.actor = new Big.Box({ background_color : POPUP_BG_COLOR,
corner_radius: POPUP_GRID_SPACING,
padding: POPUP_GRID_SPACING,
},
show : function(initialSelection) {
- let global = Shell.Global.get();
-
global.window_group.add_actor(this._overlay);
this._overlay.raise_top();
this._overlay.show();
},
_adjust_overlay : function() {
- let global = Shell.Global.get();
-
if (this._selected && this._selected.icon_rect) {
// We want to highlight a specific rectangle within the
// task bar, so rearrange the pieces of the overlay to
// Draggable target interface
acceptDrop : function(source, actor, x, y, time) {
- let global = Shell.Global.get();
-
let appSystem = Shell.AppSystem.get_default();
let app = null;
Chrome.prototype = {
_init: function() {
- let global = Shell.Global.get();
-
// The group itself has zero size so it doesn't interfere with DND
this.actor = new Clutter.Group({ width: 0, height: 0 });
global.stage.add_actor(this.actor);
},
_windowsRestacked: function() {
- let global = Shell.Global.get();
let windows = global.get_windows();
// The chrome layer should be visible unless there is a window
},
_updateRegions: function() {
- let global = Shell.Global.get();
let rects = [], struts = [], i;
delete this._updateRegionIdle;
let chromeTop = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL,
spacing: 6 });
- let global = Shell.Global.get();
let closeIconUri = "file://" + global.imagedir + "close.svg";
let closeIcon = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
closeIconUri,
padding_right: 4 });
box.append(this._iconBox, Big.BoxPackFlags.END);
- let global = Shell.Global.get();
let magnifierUri = "file://" + global.imagedir + "magnifier.svg";
this._magnifierIcon = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
magnifierUri, 18, 18);
border_right: SECTION_BORDER,
border_color: SECTION_BORDER_COLOR });
- let global = Shell.Global.get();
let backIconUri = "file://" + global.imagedir + "back.svg";
let backIcon = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
backIconUri,
Dash.prototype = {
_init : function() {
- let global = Shell.Global.get();
-
// dash and the popup panes need to be reactive so that the clicks in unoccupied places on them
// are not passed to the transparent background underneath them. This background is used for the workspaces area when
// the additional dash panes are being shown and it handles clicks by closing the additional panes, so that the user
},
show: function() {
- let global = Shell.Global.get();
global.stage.set_key_focus(this._searchEntry.entry);
},
spacing: DEFAULT_PADDING });
this._infoContent.append(this._infoText, Big.BoxPackFlags.EXPAND);
- let global = Shell.Global.get();
let infoIconUri = "file://" + global.imagedir + "info.svg";
let infoIcon = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
infoIconUri,
Mainloop.idle_add(Lang.bind(this,
function() {
let [child, x, y, mask] = Gdk.Screen.get_default().get_root_window().get_pointer();
- let global = Shell.Global.get();
let actor = global.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE,
x, y);
if (actor != null) {
Inspector.prototype = {
_init: function() {
- let global = Shell.Global.get();
let width = 150;
let eventHandler = new Big.Box({ background_color: LG_BACKGROUND_COLOR,
border: 1,
}));
eventHandler.connect('button-press-event', Lang.bind(this, function (actor, event) {
- let global = Shell.Global.get();
Clutter.ungrab_pointer(eventHandler);
let [stageX, stageY] = event.get_coords();
}));
eventHandler.connect('motion-event', Lang.bind(this, function (actor, event) {
- let global = Shell.Global.get();
let [stageX, stageY] = event.get_coords();
let target = global.stage.get_actor_at_pos(Clutter.PickMode.ALL,
stageX,
LookingGlass.prototype = {
_init : function() {
- let global = Shell.Global.get();
-
this._idleHistorySaveId = 0;
let historyPath = global.configdir + "/lookingglass-history.txt";
this._historyFile = Gio.file_new_for_path(historyPath);
if (!Main.beginModal())
return;
- let global = Shell.Global.get();
global.stage.set_key_focus(this._entry);
Tweener.addTween(this.actor, { time: 0.5,
let inModal = false;
function start() {
- let global = Shell.Global.get();
+ // Add a binding for "global" in the global JS namespace; (gjs
+ // keeps the web browser convention of having that namespace be
+ // called "window".)
+ window.global = Shell.Global.get();
Gio.DesktopAppInfo.set_desktop_env("GNOME");
}
function _relayout() {
- let global = Shell.Global.get();
panel.actor.set_size(global.screen_width, Panel.PANEL_HEIGHT);
overview.relayout();
}
// is called.)
function _removeUnusedWorkspaces() {
- let global = Shell.Global.get();
-
let windows = global.get_windows();
let maxWorkspace = 0;
for (let i = 0; i < windows.length; i++) {
// the stage. Returns true if we successfully grabbed the keyboard and
// went modal, false otherwise
function beginModal() {
- let global = Shell.Global.get();
let timestamp = global.screen.get_display().get_current_time();
if (!global.begin_modal(timestamp))
}
function endModal() {
- let global = Shell.Global.get();
let timestamp = global.screen.get_display().get_current_time();
global.end_modal(timestamp);
}
function createAppLaunchContext() {
- let global = Shell.Global.get();
let screen = global.screen;
let display = screen.get_display();
_init : function() {
let me = this;
- let global = Shell.Global.get();
-
this._group = new Clutter.Group();
this._group._delegate = this;
},
_recalculateGridSizes: function () {
- let global = Shell.Global.get();
-
wideScreen = (global.screen_width/global.screen_height > WIDE_SCREEN_CUT_OFF_RATIO);
// We divide the screen into an imaginary grid which helps us determine the layout of
},
relayout: function () {
- let global = Shell.Global.get();
-
let screenHeight = global.screen_height;
let screenWidth = global.screen_width;
this.visible = true;
this.animationInProgress = true;
- let global = Shell.Global.get();
-
this._dash.show();
/* TODO: make this stuff dynamic */
if (!this.visible || this._hideInProgress)
return;
- let global = Shell.Global.get();
-
this.animationInProgress = true;
this._hideInProgress = true;
if (this._activeDisplayPane != null)
},
_hideDone: function() {
- let global = Shell.Global.get();
-
global.window_group.show();
this._workspaces.destroy();
Panel.prototype = {
_init : function() {
- let global = Shell.Global.get();
-
this.actor = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL
});
RunDialog.prototype = {
_init : function() {
- let global = Shell.Global.get();
-
this._isOpen = false;
this._internalCommands = { 'lg':
}),
'r': Lang.bind(this, function() {
- let global = Shell.Global.get();
global.reexec_self();
}),
// Developer brain backwards compatibility
'restart': Lang.bind(this, function() {
- let global = Shell.Global.get();
global.reexec_self();
})
};
this._isOpen = true;
this._group.show();
- let global = Shell.Global.get();
global.stage.set_key_focus(this._entry);
},
Sidebar.prototype = {
_init : function() {
- let global = Shell.Global.get();
-
// The top-left corner of the sidebar is fixed at:
// x = -WidgetBox.WIDGETBOX_PADDING, y = Panel.PANEL_HEIGHT.
// (The negative X is so that we don't see the rounded
},
_updateCairo: function(time) {
- let global = Shell.Global.get();
Shell.draw_clock(this.collapsedActor,
time.getHours() % 12,
time.getMinutes());
this.actor = new Clutter.Clone({ source: window.get_texture(),
reactive: true });
} else {
- let global = Shell.Global.get();
this.actor = new Clutter.Rectangle({ color: global.stage.color,
reactive: true,
width: global.screen_width,
Workspace.prototype = {
_init : function(workspaceNum, parentActor) {
let me = this;
- let global = Shell.Global.get();
this.workspaceNum = workspaceNum;
this._metaWorkspace = global.screen.get_workspace_by_index(workspaceNum);
},
updateRemovable : function() {
- let global = Shell.Global.get();
let removable = (this._windows.length == 1 /* just desktop */ &&
this.workspaceNum != 0 &&
this.workspaceNum == global.screen.n_workspaces - 1);
// Mark the workspace selected/not-selected
setSelected : function(selected) {
- let global = Shell.Global.get();
// Don't draw a frame if we only have one workspace
if (selected && global.screen.n_workspaces > 1) {
if (this._frame)
// is true, then the workspace is moving at the same time and we need to take
// that into account
positionWindows : function(workspaceZooming) {
- let global = Shell.Global.get();
-
let totalVisible = 0;
for (let i = 1; i < this._windows.length; i++) {
},
_windowRemoved : function(metaWorkspace, metaWin) {
- let global = Shell.Global.get();
let win = metaWin.get_compositor_private();
// find the position of the window in our list
// Animates the addition of a new (empty) workspace
slideIn : function(oldScale) {
- let global = Shell.Global.get();
-
if (this.gridCol > this.gridRow) {
this.actor.set_position(global.screen_width, this.gridY);
this.actor.set_scale(oldScale, oldScale);
// Animates the removal of a workspace
slideOut : function(onComplete) {
- let global = Shell.Global.get();
let destX = this.actor.x, destY = this.actor.y;
this._hideAllIcons();
},
destroy : function() {
- let global = Shell.Global.get();
-
Tweener.removeTweens(this.actor);
this.actor.destroy();
this.actor = null;
},
_removeSelf : function(actor, event) {
- let global = Shell.Global.get();
let screen = global.screen;
let workspace = screen.get_workspace_by_index(this.workspaceNum);
// Draggable target interface
acceptDrop : function(source, actor, x, y, time) {
- let global = Shell.Global.get();
-
if (source instanceof WindowClone) {
let win = source.realWindow;
if (this._isMyWindow(win))
Workspaces.prototype = {
_init : function(width, height, x, y, addButtonSize, addButtonX, addButtonY) {
- let global = Shell.Global.get();
-
this.actor = new Clutter.Group();
this._appIdFilter = null;
// Should only be called from active Overview context
activateWindowFromOverview: function (metaWindow, time) {
- let global = Shell.Global.get();
let activeWorkspaceNum = global.screen.get_active_workspace_index();
let windowWorkspaceNum = metaWindow.get_workspace().index();
},
hide : function() {
- let global = Shell.Global.get();
let activeWorkspaceIndex = global.screen.get_active_workspace_index();
let activeWorkspace = this._workspaces[activeWorkspaceIndex];
},
destroy : function() {
- let global = Shell.Global.get();
-
for (let w = 0; w < this._workspaces.length; w++)
this._workspaces[w].destroy();
this._workspaces = [];
// Get the grid position of the active workspace.
getActiveWorkspacePosition : function() {
- let global = Shell.Global.get();
let activeWorkspaceIndex = global.screen.get_active_workspace_index();
let activeWorkspace = this._workspaces[activeWorkspaceIndex];
},
_workspacesChanged : function() {
- let global = Shell.Global.get();
-
let oldNumWorkspaces = this._workspaces.length;
let newNumWorkspaces = global.screen.n_workspaces;
},
_appendNewWorkspace : function() {
- let global = Shell.Global.get();
-
global.screen.append_new_workspace(false, global.screen.get_display().get_current_time());
},
height: buttonSize,
reactive: true });
this._acceptDropCallback = acceptDropCallback;
- let global = Shell.Global.get();
this.actor._delegate = this;
this.actor.set_from_file(global.imagedir + 'add-workspace.svg');
},